class Resource {

  String name; // 资源名称
  String controllerName; //
  String actionName;
  String resourceType; // 资源类型
  Integer orderNum; // 资源排序字段
  Resource parent; // 父菜单
  static hasMany = [authorities:Authority];
  static belongsTo = [Authority];

    static constraints = {
      controllerName(blank:false);
      actionName(blank:false,unique:'controllerName');
      resourceType(blank:false,inList:["menu","url"]);
      name(blank:false);
      orderNum(number:true);
      parent(nullable:true);
    }
}
